/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.library.service;

import org.springblade.modules.library.bo.AutoExtractParamBO;
import org.springblade.modules.library.entity.QuestionBankEntity;
import org.springblade.modules.library.excel.QuestionBankExcel;
import org.springblade.modules.library.vo.QuestionBankVO;
import org.springblade.core.mp.base.BaseService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.library.vo.QuestionTypeNumVO;
import org.springblade.modules.system.excel.UserExcel;

import java.util.List;

/**
 * 试题题库 服务类
 *
 * @author
 * @since 2023-03-22
 */
public interface IQuestionBankService extends BaseService<QuestionBankEntity> {

	/**
	 * 自定义分页
	 *
	 * @param page
	 * @param questionBank
	 * @return
	 */
	IPage<QuestionBankEntity> selectQuestionBankPage(IPage<QuestionBankEntity> page, QuestionBankVO questionBank);

	/**
	 * 客户端 题目练习分页列表
	 * @return
	 */
	IPage<QuestionBankVO> clientQuestionBankList(IPage<QuestionBankVO> page, QuestionBankVO questionBank);
	/**
	 * 根据条件查询试题
	 * @param bo
	 * @return
	 */
	List<QuestionBankVO> selectQuestionByParams(AutoExtractParamBO bo);


	/**
	 * 根据条件查询试题
	 * @param bo
	 * @return
	 *
	 * 不附带选项的
	 */
	List<QuestionBankVO> selectQuestionBankByParams(AutoExtractParamBO bo);

	/**
	 * 查询试题详情
	 * @param questionBank
	 * @return
	 */
	QuestionBankVO selectQuestionDetails(QuestionBankEntity questionBank);

	/**
	 * 查询课后习题的试题及选项详情
	 */
	List<QuestionBankVO> selectSubBankQuestionAndOption(Long subId,Integer type);

	/**
	 * 可根据题库名称、题目性质去查询各类型题的数量
	 */
	List<QuestionTypeNumVO> getQuestionTypeByBankNameAndQuestionProperties(QuestionBankEntity questionBankEntity);

	/**
	 * 查询题库中的题目
	 * @param page
	 * @param questionBank
	 * @return
	 */
	IPage<QuestionBankVO> getQuestionPage(IPage<QuestionBankVO> page, QuestionBankVO questionBank);

	/**
	 * 检测该题目是否完整的
	 * 单选题 是否有两个及两个以上的选项
	 * 多选题 是否有两个及两个以上的选项
	 * 判断题 是否有且仅有两个选项
	 */
	boolean questionCompleteFlag(Long questionId,Integer questionType);
}
